<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/20
 * Time: 9:20
 */
namespace app\index\controller;

use think\Controller;

class Task extends Base
{


    private $task_key_model = null;

    private $task_model = null;

    public function _initialize()
    {
        parent::_initialize();
        $this->task_key_model = new \app\common\model\shop\task\Key;
        $this->task_model   = new \app\common\model\shop\Task;
    }



    //点击任务跳转到
    public function task_act($task=NULL){

        $task_info = $this->task_key_model
                    ->with(["task"=>function($q){$q->with(["shop"=>function($qr){$qr->field("shop_name,shop_id");}])->where("task_status",2);}])
                    ->where("take_key_id",$task)
                    ->find();
        $rankTypeList = $this->task_model->getRankingType();
        $this->assign("task_info",$task_info);
        $this->assign("rankTypeList",$rankTypeList);
        return $this->fetch('shop/orderDetail');

    }




}